cmake_minimum_required(VERSION 2.8.2)
project(Obstacle-Cluster)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3")
set(CMAKE_CXX_STANDARD 17)

find_package(catkin REQUIRED COMPONENTS
    tf
    roscpp
    pcl_ros
    pcl_conversions
    sensor_msgs
    std_msgs
)

find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})

find_package(PCL REQUIRED QUIET)
find_package(OpenCV REQUIRED QUIET)
include(cmake/glog.cmake)

catkin_package(
  INCLUDE_DIRS include
#  LIBRARIES Obstacle-Cluster
#  CATKIN_DEPENDS roscpp
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
    include
    ${catkin_INCLUDE_DIRS}
    ${PCL_INCLUDE_DIRS}
    ${OpenCV_INCLUDE_DIRS}
)

link_directories(
    include
    ${OpenCV_LIBRARY_DIRS}
    ${PCL_LIBRARY_DIRS}
)

file(GLOB_RECURSE ALL_SRC "src/*.cpp")

add_executable(LidarObjNodeDepth node/LidarObjNode_Depth.cpp ${ALL_SRC})
add_dependencies(LidarObjNodeDepth ${catkin_EXPORTED_TARGETS})
target_link_libraries(LidarObjNodeDepth ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${GLOG_LIBRARIES})

add_executable(LidarObjNodeEuclidean node/LidarObjNode_Euclidean.cpp ${ALL_SRC})
add_dependencies(LidarObjNodeEuclidean ${catkin_EXPORTED_TARGETS})
target_link_libraries(LidarObjNodeEuclidean ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${GLOG_LIBRARIES})


